<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNewsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('news', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->default('')->comment('新闻标题');
            $table->string('brief')->default('')->comment('新闻简介');
            $table->string('user_id')->default(0)->comment('关联作者');
            $table->string('icon')->default('')->comment('新闻缩略图');
            $table->text('content')->comment('新闻内容');
            $table->text('editormd')->comment('新闻内容');
            $table->unsignedInteger('classify_id')->defualt(0)->comment('关联的类型id');

//            $table->foreign('classify_id')->references('id')->on('classifies')->onDelete('cascade');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('news');
    }
}
